const service = require('./passService.js')
const utils = require('../../../utils/util');

Page({

  /**
   * 页面的初始数据
   */
  data: {
    rankList: [
    ],
    mine: {
    },
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var self = this;
    service.getpassStar(3, function (res) {//this.data.type
      let newNoReseiveData = res.execData.periods.filter(item => {
        // 过期false, 未过期为true
        +new Date() <= +new Date(item.deadline) ? item.isOverdue = true : item.isOverdue = false
        item.end_time = utils.formatDateDot(item.end_time)
        return item
      });
      self.setData({
        rankList: res.execData.periods
      })
    });
  },
  timeformat: function (time) {
    var time1 = time.substring(0,9);
    return time.substring(0, 9)
  },
})